<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/thread/Event.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_bfedb72b9d87795234454f6223b9ab1e.html">thread</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Event.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_event_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __CEVENTBASE_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __CEVENTBASE_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_wait_status_8h.html">WaitStatus.h</a>&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_shared_ptr_8h.html">SharedPtr.h</a>&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_c_event_base.html">   12</a></span>&#160;<span class="keyword">class </span><a class="code" href="tools_8h.html#a64152c8b939d1ce06c7c5cb6c97b62f8">LIBTOOLS</a> <a class="code" href="class_c_event_base.html">CEventBase</a></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;{</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    <a class="code" href="tools_8h.html#af0d60cfe49f1e07cbec28c12afc4343e">delete_class_copy_operator</a>(<a class="code" href="class_c_event_base.html">CEventBase</a>);</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="class_c_event_base.html#ab875c6421774b41bd55c69212e06ae89">   21</a></span>&#160;    <a class="code" href="class_c_event_base.html#ab875c6421774b41bd55c69212e06ae89">CEventBase</a>(<span class="keywordtype">bool</span> status = <span class="keyword">false</span>, <span class="keywordtype">bool</span> reset = <span class="keyword">true</span>) {}</div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="class_c_event_base.html#aba686a47a406e6b8c164220c98b814ef">   22</a></span>&#160;    <span class="keyword">virtual</span> <a class="code" href="class_c_event_base.html#aba686a47a406e6b8c164220c98b814ef">~CEventBase</a>() {}</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="_wait_status_8h.html#aefc65d67c2144bee893b543992f694e2">wt_status</a> Wait(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pred) = 0;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="_wait_status_8h.html#aefc65d67c2144bee893b543992f694e2">wt_status</a> Wait_Forever() = 0;</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="namespace_share_api.html#aef9c08d248e17a517235723ef2db9663">SetEvent</a>(<span class="keywordtype">bool</span> status) = 0;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="tools_8h.html#a01e895c2df346ffe662bbe69686d8d51">SYNCHANDLE</a> Handle() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;};</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="class_c_event.html">   47</a></span>&#160;<span class="keyword">class </span><a class="code" href="tools_8h.html#a64152c8b939d1ce06c7c5cb6c97b62f8">LIBTOOLS</a> <a class="code" href="class_c_event.html">CEvent</a> :<span class="keyword">public</span> <a class="code" href="class_c_event_base.html">CEventBase</a></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;{</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <a class="code" href="class_c_event_base.html#a6a31f65af111ea64f42743d6b065a407">delete_class_copy_operator</a>(<a class="code" href="class_c_event.html">CEvent</a>);</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="comment">/* 初始化创建一个事件，若失败则抛出异常，使用标准exception可进行捕获</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">     * @status:初始状态是否有信号</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">     * @reset:是否自动重置事件</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">    */</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <a class="code" href="class_c_event.html">CEvent</a>(<span class="keywordtype">bool</span> status = <span class="keyword">false</span>, <span class="keywordtype">bool</span> reset = <span class="keyword">true</span>);</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_c_event.html">CEvent</a>();</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="_wait_status_8h.html#aefc65d67c2144bee893b543992f694e2">wt_status</a> <a class="code" href="class_c_event_base.html#a34f33f39578574417d5dfa174faa921d">Wait</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pred);</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="_wait_status_8h.html#aefc65d67c2144bee893b543992f694e2">wt_status</a> <a class="code" href="class_c_event_base.html#abe9657c5257a91dfb4b2bf73e13a9a07">Wait_Forever</a>();</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_event_base.html#a0c53f1d6c89e9a6cf4f0b168f2565e23">SetEvent</a>(<span class="keywordtype">bool</span> status);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="tools_8h.html#a01e895c2df346ffe662bbe69686d8d51">SYNCHANDLE</a> <a class="code" href="class_c_event_base.html#acc35df69c7c84c210f845976b4f060f1">Handle</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="class_c_event.html#a8d111caf7221ea4c35980af8bae632c4">   77</a></span>&#160;    <a class="code" href="tools_8h.html#a01e895c2df346ffe662bbe69686d8d51">SYNCHANDLE</a> <a class="code" href="class_c_event.html#a8d111caf7221ea4c35980af8bae632c4">_event</a>;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;};</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="class_c_wait_multi_event.html">   83</a></span>&#160;<span class="keyword">class </span><a class="code" href="tools_8h.html#a64152c8b939d1ce06c7c5cb6c97b62f8">LIBTOOLS</a> <a class="code" href="class_c_wait_multi_event.html">CWaitMultiEvent</a></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;{</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <a class="code" href="tools_8h.html#af0d60cfe49f1e07cbec28c12afc4343e">delete_class_copy_operator</a>(<a class="code" href="class_c_wait_multi_event.html">CWaitMultiEvent</a>);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <a class="code" href="class_c_wait_multi_event.html">CWaitMultiEvent</a>(<span class="keyword">const</span> std::vector&lt;CEventBase*&gt;&amp; ves, <span class="keywordtype">bool</span> waitall, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pred, <a class="code" href="_wait_status_8h.html#aefc65d67c2144bee893b543992f694e2">wt_status</a>&amp; status, <span class="keywordtype">int</span> *index = 0);</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;};</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="class_c_wait_multi_event_forever.html">  101</a></span>&#160;<span class="keyword">class </span><a class="code" href="tools_8h.html#a64152c8b939d1ce06c7c5cb6c97b62f8">LIBTOOLS</a> <a class="code" href="class_c_wait_multi_event_forever.html">CWaitMultiEventForever</a></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;{</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <a class="code" href="tools_8h.html#af0d60cfe49f1e07cbec28c12afc4343e">delete_class_copy_operator</a>(<a class="code" href="class_c_wait_multi_event_forever.html">CWaitMultiEventForever</a>);</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    </div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <a class="code" href="class_c_wait_multi_event_forever.html">CWaitMultiEventForever</a>(<span class="keyword">const</span> std::vector&lt;CEventBase*&gt;&amp; ves, <span class="keywordtype">bool</span> waitall, <a class="code" href="_wait_status_8h.html#aefc65d67c2144bee893b543992f694e2">wt_status</a>&amp; status, <span class="keywordtype">int</span> *index = 0);</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;};</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="preprocessor">#endif // __CEVENTBASE_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_c_event_base_html_aba686a47a406e6b8c164220c98b814ef"><div class="ttname"><a href="class_c_event_base.html#aba686a47a406e6b8c164220c98b814ef">CEventBase::~CEventBase</a></div><div class="ttdeci">virtual ~CEventBase()</div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00022">Event.h:22</a></div></div>
<div class="ttc" id="aclass_c_event_html_a8d111caf7221ea4c35980af8bae632c4"><div class="ttname"><a href="class_c_event.html#a8d111caf7221ea4c35980af8bae632c4">CEvent::_event</a></div><div class="ttdeci">SYNCHANDLE _event</div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00077">Event.h:77</a></div></div>
<div class="ttc" id="atools_8h_html_af0d60cfe49f1e07cbec28c12afc4343e"><div class="ttname"><a href="tools_8h.html#af0d60cfe49f1e07cbec28c12afc4343e">delete_class_copy_operator</a></div><div class="ttdeci">#define delete_class_copy_operator(ClassName)</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00345">tools.h:345</a></div></div>
<div class="ttc" id="aclass_c_event_base_html_ab875c6421774b41bd55c69212e06ae89"><div class="ttname"><a href="class_c_event_base.html#ab875c6421774b41bd55c69212e06ae89">CEventBase::CEventBase</a></div><div class="ttdeci">CEventBase(bool status=false, bool reset=true)</div><div class="ttdoc">初始化创建一个事件</div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00021">Event.h:21</a></div></div>
<div class="ttc" id="aclass_c_event_base_html_acc35df69c7c84c210f845976b4f060f1"><div class="ttname"><a href="class_c_event_base.html#acc35df69c7c84c210f845976b4f060f1">CEventBase::Handle</a></div><div class="ttdeci">virtual SYNCHANDLE Handle() const =0</div><div class="ttdoc">返回时间句柄</div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="atools_8h_html_a64152c8b939d1ce06c7c5cb6c97b62f8"><div class="ttname"><a href="tools_8h.html#a64152c8b939d1ce06c7c5cb6c97b62f8">LIBTOOLS</a></div><div class="ttdeci">#define LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00095">tools.h:95</a></div></div>
<div class="ttc" id="aclass_c_event_base_html_a0c53f1d6c89e9a6cf4f0b168f2565e23"><div class="ttname"><a href="class_c_event_base.html#a0c53f1d6c89e9a6cf4f0b168f2565e23">CEventBase::SetEvent</a></div><div class="ttdeci">virtual void SetEvent(bool status)=0</div><div class="ttdoc">设置事件是否有信号</div></div>
<div class="ttc" id="aclass_c_event_html"><div class="ttname"><a href="class_c_event.html">CEvent</a></div><div class="ttdoc">事件类</div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00047">Event.h:47</a></div></div>
<div class="ttc" id="a_wait_status_8h_html"><div class="ttname"><a href="_wait_status_8h.html">WaitStatus.h</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="aclass_c_event_base_html_a6a31f65af111ea64f42743d6b065a407"><div class="ttname"><a href="class_c_event_base.html#a6a31f65af111ea64f42743d6b065a407">CEventBase::delete_class_copy_operator</a></div><div class="ttdeci">delete_class_copy_operator(CEventBase)</div></div>
<div class="ttc" id="a_shared_ptr_8h_html"><div class="ttname"><a href="_shared_ptr_8h.html">SharedPtr.h</a></div></div>
<div class="ttc" id="aclass_c_event_base_html_abe9657c5257a91dfb4b2bf73e13a9a07"><div class="ttname"><a href="class_c_event_base.html#abe9657c5257a91dfb4b2bf73e13a9a07">CEventBase::Wait_Forever</a></div><div class="ttdeci">virtual wt_status Wait_Forever()=0</div><div class="ttdoc">一直等待事件，直到有信号时退出</div></div>
<div class="ttc" id="a_wait_status_8h_html_aefc65d67c2144bee893b543992f694e2"><div class="ttname"><a href="_wait_status_8h.html#aefc65d67c2144bee893b543992f694e2">wt_status</a></div><div class="ttdeci">wt_status</div><div class="ttdef"><b>Definition:</b> <a href="_wait_status_8h_source.html#l00011">WaitStatus.h:11</a></div></div>
<div class="ttc" id="aclass_c_event_base_html_a34f33f39578574417d5dfa174faa921d"><div class="ttname"><a href="class_c_event_base.html#a34f33f39578574417d5dfa174faa921d">CEventBase::Wait</a></div><div class="ttdeci">virtual wt_status Wait(unsigned int pred)=0</div><div class="ttdoc">等待事件有信号</div></div>
<div class="ttc" id="anamespace_share_api_html_aef9c08d248e17a517235723ef2db9663"><div class="ttname"><a href="namespace_share_api.html#aef9c08d248e17a517235723ef2db9663">ShareApi::SetEvent</a></div><div class="ttdeci">LIBTOOLS BOOL SetEvent(SYNCHANDLE hEvent, BOOL bEvent)</div><div class="ttdoc">设置句柄是否有事件</div><div class="ttdef"><b>Definition:</b> <a href="_share_api_8cpp_source.html#l01291">ShareApi.cpp:1291</a></div></div>
<div class="ttc" id="aclass_c_wait_multi_event_forever_html"><div class="ttname"><a href="class_c_wait_multi_event_forever.html">CWaitMultiEventForever</a></div><div class="ttdoc">等待多个事件包装器</div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00101">Event.h:101</a></div></div>
<div class="ttc" id="aclass_c_event_base_html"><div class="ttname"><a href="class_c_event_base.html">CEventBase</a></div><div class="ttdoc">事件处理基类</div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00012">Event.h:12</a></div></div>
<div class="ttc" id="atools_8h_html_a01e895c2df346ffe662bbe69686d8d51"><div class="ttname"><a href="tools_8h.html#a01e895c2df346ffe662bbe69686d8d51">SYNCHANDLE</a></div><div class="ttdeci">#define SYNCHANDLE</div><div class="ttdoc">异步函数句柄</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00329">tools.h:329</a></div></div>
<div class="ttc" id="aclass_c_wait_multi_event_html"><div class="ttname"><a href="class_c_wait_multi_event.html">CWaitMultiEvent</a></div><div class="ttdoc">等待事件包装器</div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00083">Event.h:83</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
